<script setup>
import { ref, reactive, toRefs, toRef } from "vue";
let person = reactive({ name: "666", age: 18 });
let { name, age } = toRefs(person);
function changeName() {
  name.value += "sb";
}
function changeAge() {
  age.value += 1;
}
let ppp = toRef(person, "age");
</script>
<template>
  <h3>姓名:{{ name }}</h3>
  <h3>年龄:{{ ppp }}</h3>
  <button @click="changeName">点我改名</button>
  <button @click="changeAge">点我改年龄</button>
</template>
